home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-18 | 2.3 KB | 64 lines | [TEXT/MPS ] |
- # Macintosh Programmer’s Assistant
- # Copyright © 1986-1996 Apple Computer, Inc. All rights reserved.
- #
- # -- brain surgery provided by the MPW Gurus, 1/12/95, 3/29/96
- #
- # ------------------------------- #
- # UserStartup•MPTA
- # ------------------------------- #
- #
- # Put this file in the same folder as the MPW Shell.
- #
- # This startup script defines the {MPTA_Location} and {MPTA_AppName} variables
- # for use by the MPTA_MPWAccess script.
- #
- # It also adds a menu called "Info" to the MPW Shell menu bar with items that
- # let you look up the description of a toolbox routine, the description of an
- # MPW command, or return the C template for a toolbox routine.
- #
-
- set saveExit {Exit}
- set exit 0
- set hasSendAE "`which SendAE ≥dev:null`"
- if "{hasSendAE}" ≠ ""
- # Set the location of the Macintosh Programmer’s Assistant folder.
- # If the folder can’t be found, prompt the user for it and remember
- # where the folder was found.
- # Note that we have to make sure that the path is still valid.
- # There may be a path stored that is no longer valid.
-
- if ¬ "{MPTA_Location}" && "`Exists "{ShellDirectory}"MPTA_FullPathName`"
- Set MPTA_Location "`Catenate "{ShellDirectory}"MPTA_FullPathName`"
- end
-
- If ¬ "`Exists "{ShellDirectory}"MPTA_FullPathName`" || ¬ "`Exists "{MPTA_Location}"`"
- Set temp "{ShellDirectory}"
- Set temp "`(GetFileName "{temp}" -b "Here It Is" -t APPL -q -m "Locate the QuickView application.") ≥ dev:null`"
- IF "{temp}"!= ""
- Echo -n "{temp}" > "{ShellDirectory}"MPTA_FullPathName
- END
- set exit 1
- end
-
- if "`Exists "{ShellDirectory}"MPTA_FullPathName`"
-
- Addmenu "Info" "Home Page" ('MPTA_MPWAccess LookupHomePage')
- Addmenu "Info" '(-0' ''
- Addmenu "Info" "Look Up Routine/E" ('MPTA_MPWAccess Lookup')
- Addmenu "Info" "Look Up MPW Command" ('MPTA_MPWAccess LookupMPW')
- Addmenu "Info" "Get Template/1" ('MPTA_MPWAccess GetTemplate')
- # Addmenu "Info" '(-0' ''
- # Addmenu "Info" "Release Notes" ('MPTA_MPWAccess LookupReleaseNotes')
-
- Set MPTA_Location "`Catenate "{ShellDirectory}"MPTA_FullPathName`"
- (evaluate "{MPTA_Location}" =~ /(([¬:]+:)*)(≈)®1/ ) > Dev:Null
- Set MPTA_AppName "{®1}"
- Export MPTA_Location MPTA_AppName
- end
- else
- Alert "Macintosh Programmer’s Assistant cannot locate the ‘SendAE’ tool. Please reinstall Programmer’s Assistant properly."
- end
-
- set exit {saveExit}
- unset hasSendAE saveExit
-